#pragma once

#include "IReadingInformation.h"
#include "afxwin.h"
#include "chart.h"
#include "afxdtctl.h"

#include "GraphTestReadingInformation.h"

// HistoryGraph dialog

class HistoryGraph : public CDialog
{
	DECLARE_DYNAMIC(HistoryGraph)

public:
	HistoryGraph(CWnd* pParent = NULL);   // standard constructor
	virtual ~HistoryGraph();

// Dialog Data
	enum { IDD = IDD_SHOWHISTORY };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedSavebutton();
	int GetEncoderClsid(const WCHAR* format, CLSID* pClsid);
	void gdiscreen();
	void myTest();

private:
	Sensor::IReadingInformation* readingInformation;
	COleDateTime startTime;
	COleDateTime endTime;
public:
	BOOL HistoryGraph::OnInitDialog();
	void setReadingInformation(Sensor::IReadingInformation* readingInformation) {
		this->readingInformation = readingInformation;
		chart.setReadingInformation(readingInformation); // FIXME
	}
private:
	void HistoryGraph::SetDropDownHeight(CComboBox* pMyComboBox, int itemsToShow);
protected:
	CComboBox sensorIdCombo;
public:
	afx_msg void OnCbnSelchangeSensorIdCombo();
	CComboBox readingTypeCombo;
	Chart chart;
	afx_msg void OnDtnDatetimechangeDatetimepicker1(NMHDR *pNMHDR, LRESULT *pResult);
	CDateTimeCtrl startDateTime;
	afx_msg void OnCbnSelchangeReadingTypeCombo();
private:
	CDateTimeCtrl endDateTime;
public:
	afx_msg void OnDtnDatetimechangeDatetimepickerEnd(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedButton2();
};
